package com.selenium.xls.read;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Creating_Reading_Writting_ExcelFile {
	
	public static void main(String[] args) throws IOException{
		
		// Creating
		File f = new File("E:\\temp.txt");
		f.createNewFile();
		
		// Writting
		FileWriter fileWritter = new FileWriter(f);
		BufferedWriter out = new BufferedWriter(fileWritter);
		out.write("We are writting in a file");
		out.newLine();
		out.write("This is a new line");
		out.flush();
		
		//Reading
		FileReader reader = new FileReader(f);
		BufferedReader in = new BufferedReader(reader);
		String x ="";
		
		// Print all of the properties
		while( (x = in.readLine())!= null){
			System.out.println(x);
			
			
		}
		
		
	}

}
